﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Rose.Models;

namespace Rose.Helper
{
    public class IsExistHelpModel
    {
        private  Database_RoseEntities db = new Database_RoseEntities();
        public  bool IsUserInfoExist(string id)
        {
            return db.UserInfos.Where(c => c.Id == id).Count() > 0 ? true : false;
        }

      

        public  bool IsAlbumExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.Albums.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }

        public  bool IsArticleExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.Articles.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }
        public  bool IsArticleCommentExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.ArticleComments.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }

        public  bool IsFavoriteExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.Favorites.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }
        public  bool IsFeedBackExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.FeedBacks.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }

        public  bool IsFeelingCommentExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.FeelingComments.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }

        public  bool IsFeelingExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.Feelings.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }

        public  bool IsFocusRelationExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.FocusRelations.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }

        public  bool IsFriendRelationExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.FriendRelations.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }

        public  bool IsRequestFriendExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.RequestFriends.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }

        public  bool IsLoverRelationExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.LoverRelations.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }
        public  bool IsRequestLoverExist(string id)
        {
            Guid guidId = new Guid(id);
            return db.RequestLovers.Where(c => c.Id == guidId).Count() > 0 ? true : false;
        }
       


        public  bool IsFriendRelationExist(string selfId, string friendId)
        {
            return db.FriendRelations.Where(c => c.UserId == selfId && c.FriendId == friendId).Count() > 0 ? true : false;
        }

        public  bool IsLoverRelationExist(string manId, string womanId)
        {
            return db.LoverRelations.Where(c => c.ManId == manId && c.WomanId == womanId).Count() > 0 ? true : false;
        }

        public  bool IsFocusRelationExist(string selfId, string focusId)
        {
            return db.FocusRelations.Where(c => c.UserId == selfId && c.FocusId == focusId).Count() > 0 ? true : false;
        }

    }
}